#include "pch.h"
#include "Renderer.h"
#include "Cheat.h"
#include "UserInterface.h"

Renderer* Renderer::m_pInstance = nullptr;

void Renderer::Initialize()
{
	IMGUI_CHECKVERSION();
	ImGui::CreateContext();
	ImGuiIO& Io = ImGui::GetIO(); (void)Io;
	ImGui::StyleColorsDark();
	//UserInterface::GetInstance()->SetStyle();
	Io.Fonts->AddFontFromFileTTF("c:/windows/fonts/simhei.ttf",18.0f,NULL,Io.Fonts->GetGlyphRangesChineseSimplifiedCommon());
	ImGui_ImplWin32_Init(g_hWnd);
}

Renderer* Renderer::GetInstance()
{
	if (m_pInstance == NULL)
	{
		m_pInstance = new Renderer;
	}
	return m_pInstance;
}

void Renderer::Release()
{
	ImGui::DestroyContext();
	//ImGui_ImplDX11_Shutdown();
	//ImGui_ImplWin32_Shutdown();
	delete m_pInstance;
	m_pInstance = nullptr;
}